package com.lyx.dubbotest.bootserviceconsumer.controller;

import com.lyx.dubbotest.bean.UserAddress;
import com.lyx.dubbotest.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

/**
 * @author LiuYunXin
 * @create 2022-01-06-16:06
 */
@RestController
public class OrderController {

    @Autowired
    OrderService orderService;

    //@ResponseBody
    @RequestMapping("/order")
    public List<UserAddress> initOrder(@RequestParam("id") String id) throws IOException {
        List<UserAddress> addr= orderService.initOrder(id);
        return addr;
    }

    @RequestMapping("/test")
    public String test(){
        return "hello";
    }
}
